package com.hmall.client;

import com.hmall.common.dto.Address;
import com.hmall.common.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * TODO
 *
 * @Author wangxinyi
 * @Date 2024/11/16 9:20
 */
@FeignClient("userservice")
public interface UserClient {


    /**
     * 根据addressid查询Address
     */
    @GetMapping("/address/{id}")
     Address findAddressById(@PathVariable("id") Long id);


    /**
     * 根据用户id查询用户信息
     */
    @GetMapping("/user/userId")
    User getById(@RequestParam Long userId);
}
